import { ref, computed } from 'vue'
import { defineStore } from 'pinia'

export let useCopy = defineStore('showCopy', () => {

    let show_copy = ref(false);  //是否展示

    let cur_subproject_id = ref("0");

    let cur_month = ref("1"); //1-12

    let cur_subproject_arr=ref([]);//当前储能列表。


    let subproject_id_getter = computed(() => cur_subproject_id.value);
    let cur_month_getter = computed(() => cur_month.value);

    let show_copy_getter = computed(() => show_copy.value);

    let cur_subproject_arr_getter=computed(()=>cur_subproject_arr.value)


    function show_copy_fn(status) {
        show_copy.value = status   //必须使用.value
    };

    function cur_subproject_id_fn(status) {
        cur_subproject_id.value = status   //必须使用.value
    }

    function cur_month_fn(data) {
        cur_month.value = data   //必须使用.value
    }

    function cur_cur_subproject_arr_fn(data){
        cur_subproject_arr.value=data;
    }
   





    return {

        subproject_id_getter,
        cur_month_getter,
        show_copy_getter,
        show_copy_fn,
        cur_subproject_id_fn,
        cur_month_fn,

        cur_subproject_arr_getter,
        cur_cur_subproject_arr_fn

    }

});
